QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Tables of Contents

Labels

ASCII
TableOfContents
Binary
toc ( = 0x746F6320 )

Data Type Definition: toc entry type 0

TOCEntry (
    Uns32                       refID
    FilePointer                 objLocation
)

Size

12

Data Type Definition: toc entry type 1

TOCEntry (
    Uns32                       refID
    FilePointer                 objLocation
    ObjectType                  objType
)

Size

16

refID
The value of the refID field of a reference object.
objLocation
A pointer to the location of a metafile object that can be referenced.
objType
The type identifier of the target object of the file pointer listed in the objLocation field. In a text metafile, this field should appear on a separate line.

Type 1 TOC entries allow a parser to determine the type of a referenced object by inspecting tables of contents; type 0 TOC entries do not. Because QD3D 1.5 contains a new call ( Q3File_GetExternalReferences ) that makes use of this feature, in QD3D 1.5 the table of contents in both normal and database metafiles are written as type 1. In QD3D 1.0, the TOC entries in a normal metafile were written as type 0; the TOC entries in a database metafile were written as type 1.

data format

FilePointer                     nextTOC
Uns32                           refSeed
Int32                           typeSeed
Uns32                           tocEntryType
Uns32                           tocEntrySize
Uns32                           nEntries
TOCEntry                        tocEntries[nEntries]
nextTOC
A pointer to the location of the next table of contents in the metafile. (If there is no subsequent table of contents, then this pointer is idle. In a text file this means there is a file pointer but no label that resolves it. In a binary file this means that the file pointer is zero.)
refSeed
The least integer that may occur in the refID field of a reference object added to the metafile after this table of contents is written. The value in this field must be greater than 0 and is incremented whenever a new reference object is added to the preceding section of the metafile or is listed in a TOC entry added to this table of contents.
typeSeed
The greatest integer that may occur in the typeID field of a type object added to the metafile after this table of contents is written. The value in this field must be less than 0 and is decremented whenever a new type object is added to the preceding section of the metafile.
tocEntryType
A numerical constant that indicates the type of the entries contained in the table of contents. The permitted values of this field are 0 and 1. A value of 0 indicates that all entries in the array tocEntries[] are of type 0; a value of 1 indicates that all entries in that array are of type 1. The occurrence of this constant should cause no confusion, as all entries in any particular table of contents must be of the same type.
tocEntrySize
A numerical constant that indicates the binary sizes of the entries contained in the table of contents. The permitted values of this field are 12 and 16. If the value in the previous field is 0, then the value in this field must be 12; if the value in the previous field is 1, then the value in this field must be 16. Again, this constant should cause no confusion, as all entries in any particular table of contents must be of the same size.
nEntries
The number of entries contained in the table of contents; that is, the size of the array tocEntries[] . If the value in this field is 0, then that array is empty.
tocEntries[]
An array of TOCEntry objects, all of which are of the same entry type.

Data Size

20 + (tocEntrySize * nEntries)

Description

A table of contents is a structure that provides a record of associations between reference IDs and file pointers. These associations are specified by the TOC entries of the table of contents. A metafile reader must use its tables of contents to discover linkages between reference objects and file pointers, as there is no other record of those associations. See "File Pointers" and "Reference Objects" for complete details regarding these objects.

A metafile that contains a reference to another object (by means of a reference object) must include at least one table of contents.

If a metafile contains more than one table of contents, then each table of contents should continue the record provided by the immediately previous table of contents (if such exists) without duplication. A table of contents may contain information about objects occurring before or after it or both, but should not contain information about any object that either precedes an object mentioned in a previous table of contents or follows an object mentioned in a subsequent table of contents.

Parent Hierarchy

3DMF.

Parent Objects

None.

Child Objects

None.

Example

3DMetafile ( 1 5 Database
        tableofcontents0> )
    box2:
    Container (
        Box (
            0 0 1                           # orientation
            1 0 0                           # majorAxis
            0 0 0                           # minorAxis
            0 1 0                           # origin
        )
        attributeset3:
        Container (
            AttributeSet ( )
            DiffuseColor ( 0.9 0.9 0.2 )
        )
    )
    translate4:
    Translate ( 3 0 0 )
    Reference ( 1 )
    translate5:
    Translate ( 0 3 0 )
    Reference ( 1 )
    translate6:
    Translate ( -3 1 0 )
    Reference ( 1 )
    tableofcontents0:
    TableOfContents (
        tableofcontents1>                       # next TOC
        6                                       # reference seed
        -1                                      # typeSeed
        1                                       # tocEntryType
        16                                      # tocEntrySize
        5                                       # nEntries
        1 box2>
        Box
        2 attributeset3>
        AttributeSet
        3 translate4>
        Translate
        4 translate5>
        Translate
        5 translate6>
        Translate
    )

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |